//执行基础用例 样板


// 执行请求 -->（传入结果） 执行断言（存储详细结果） -->返回断言测试结果

var fly = require('flyio')
var interfacemodel = {
    url:'http://10.100.2.36:8086/api/operation/authenticate/account',
    repData:{
        login:"admin",
        password:"wujun27",
        type : "account"
    },
    headers:{
        'content-type': "application/json; charset=utf-8",
        method: 'post',
        timeout:10000,
    }
}



/*var cc =fly.request(interfacemodel.url,interfacemodel.repData,interfacemodel.headers)
    .then(res=>{
       // console.log(res)
        console.log(res.status)
        console.log(res.data)

    }).catch(err=>{
        console.log(err)
})*/


var req = function (url,repData,headers) {
   return fly.request(url,repData,headers)
}


console.log(req(interfacemodel.url,interfacemodel.repData,interfacemodel.headers))



/*
const A = new Promise( (resolve, reject) => {
    fly.request(url,repData,{
        method: 'post',
        headers: {ct},
        timeout:10000
    }).then( res => {
        console.log('A',res.data['id_token'])
        cookie = res.data['id_token']
        //加入resolve()方法后，在Promise.all().then()方法中可以对执行结果进行顺序打印
        resolve('A:'+res.data['id_token'])
    }).catch( e =>{
        reject(e)
    })
})
*/
